﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace wss测试
{
    public partial class MessageForm : Form
    {
        public MessageForm()
        {
            InitializeComponent();
        }

        private void MessageForm_Load(object sender, EventArgs e)
        {
        }

        private void MessageForm_FormClosed(object sender, FormClosedEventArgs e)
        {
        }

        private void MessageForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            e.Cancel = true;
        }

       public void SetText(string data)
        {
            this.Invoke(new EventHandler(delegate
            {// 这里面就是访问控件相关的代码了
                textBox1.Text += data + "\n\r";
            })); 
        }

    }
}
